package cn.jizi.bshisy.service.impl;

import cn.jizi.bshisy.entity.Bed;
import cn.jizi.bshisy.mapper.BedMapper;
import cn.jizi.bshisy.service.BedService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 李鹏辉Code
 * @create 2020 -11 -04 9:32
 */
@Service
public class BedServiceImpl implements BedService {
    @Resource
    private BedMapper bedMapper;

    @Transactional
    @Override
    public boolean newPatientOpen(Bed bed) {
        //标识
        boolean mark = false;
        if (bedMapper.newPatientOpen(bed) > 0)
            mark = true;//入院开床成功
        return mark;
    }

    @Transactional
    @Override
    public boolean changeBedInformation(Bed bed) {
        //标识
        boolean mark = false;
        if (bedMapper.changeBedInformation(bed) > 0)
            mark = true;//更改病床信息成功
        return mark;
    }

    @Override
    public List<Bed> queryConditionPagination(Integer iid, String mname, int limtcp, int limtps) {
        return bedMapper.queryConditionPagination(iid, mname, limtcp, limtps);
    }

    @Override
    public List<Bed> queryConditionPaginationCount(Integer iid, String mname) {
        return bedMapper.queryConditionPaginationCount(iid, mname);
    }


}
